<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="perm" uri="/WEB-INF/tld/perm.tld"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="imagePath" value="/b2b4shoumei_resources" />
<html>
<script>
	var ctx = "${ctx}";
	var imagePath = "${imagePath}";
</script>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>商品订单</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
	<meta http-equiv="expires" content="Wed, 26 Feb 209908:21:57 GMT"> 
	
	<link href="${ctx}/static/css/bootstrap.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/font-awesome.min.css?v=4.4.0?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/animate.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/style.min.css?v=${static_version}" rel="stylesheet" />
	<link href="${ctx}/static/css/common.css?v=${static_version}" rel="stylesheet" />
	<link href="//at.alicdn.com/t/font_9x03jhokyws9vn29.css" rel="stylesheet">
	<link href="${ctx}/static/css/plugins/webuploader/webuploader.css" rel="stylesheet" />
	<link href="${ctx}/static/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
	
	<!-- Data Tables -->
	<link href="${ctx}/static/css/plugins/dataTables/dataTables.bootstrap.css?v=${static_version}" rel="stylesheet" />
	<!-- 插件样式  -->
	<link href="${ctx}/static/css/plugins/markdown/bootstrap-markdown.min.css" rel="stylesheet" />
	<style type="text/css">
		.form-horizontal input[type="text"]{ padding-top:0}	
	</style>    
</head>
<body class="gray-bg">

		<div class="wrapper wrapper-content animated fadeInRight">
			<div class="ibox float-e-margins">
				
				<!-- 专场列表 -->
				<div class="ibox-title">
					<h5>特卖汇订单<small></small></h5>
				</div>
				<div class="ibox-content">
					<div class="row" >	
						<form action="${ctx}/dingdan/orderList" method="get" class="form form-horizontal" id="">
							<input type="hidden" id="type" name="type" value='3' />
							<div class="clearfix form-group">
								<div class="col-md-4" style="display: none">
									<label class="col-md-4 col-sm-4 control-label">订单类型：</label>
									<div class="col-md-8 col-sm-8">
										<span class="select-box">
											<select name="ordertype"
											class="input-md form-control chosen-select">
											<option value="-1">--全部--</option>
											<option value="1">--待付款--</option>
											<option value="2">--已付款--</option>
											<option value="3">--已发货--</option>
											<option value="4">--已收货--</option>
											<option value="5">--已取消--</option>
											<option value="6">--退货中--</option>
											<option value="7">--退货成功--</option>
											<option value="8">--退货失败--</option>
										</select>
									</span>
								</div>
							</div>
							<div class="col-md-4">
								<label class="col-md-4 col-sm-4 control-label">订单状态:</label>
								<div class="col-md-8 col-sm-8">
									<span class="select-box"> <select name="ddStatus"
										class="input-md form-control chosen-select">
										<option value="-1">--全部--</option>
										<option value="1">--待付款--</option>
										<option value="2">--已付款--</option>
										<option value="3">--已发货--</option>
										<option value="4">--已收货--</option>
										<option value="5">--已取消--</option>
										<option value="6">--退货中--</option>
										<option value="7">--退货成功--</option>
										<option value="8">--退货失败--</option>
									</select>
								</span>
							</div>
						</div><div class="col-md-3">
						<label class="col-md-4 col-sm-4 control-label">订单编号：</label>
						<div class="col-md-8 col-sm-8">
							<input type="text" name="orderNum" value="" id="rid" placeholder="订单编号" class="form-control">
						</div>
					</div>
					
					<div class="col-md-5">		
						<label class="col-md-3 col-sm-3 control-label">时间段：</label>
						<div class="col-md-9 col-sm-9">
							<div class="input-daterange input-group">
								<input id="startTime" name="startTime" type="text" class="input-md form-control layer-date" placeholder="开始时间" onclick="new WdatePicker()"> <span class="input-group-addon">至</span>
								<input id="endTime" name="endTime" type="text" class="input-md form-control layer-date" placeholder="结束时间" onclick="new WdatePicker()">
							</div>
							
							
						</div>	
						
						
					</div>
				</div>
				<div class="clearfix form-group">
					
					
					<div class="col-md-4">	
						<label class="col-md-4 col-sm-4 control-label">发票状态：</label>
						<div class="col-md-8 col-sm-8">
							<span class="select-box"> 
								<select name="fpStatus"
								class="input-md form-control chosen-select">
								<option value="-1">--全部--</option>
								<option value="0">--无--</option>
								<option value="1">--有--</option>
							</select>
						</span>
					</div>
				</div>
				<div class="col-md-3">	
					<div class="col-md-4 col-sm-4">
						<button name="" id="" class="btn btn-primary fr"
						style="border-radius: 5px; float: right;" type="submit">
						搜索</button>
						<div style="width: 10px; height: 5px; float: right;"></div>
						
					</div>
					
				</div>
			</div>
			
			
		</form>
	</div>
	<div class="hr-line-dashed3" style="height: auto"></div>
	<table data-datatable="true"
	class="table table-striped table-bordered table-hover dataTables-example">
	<thead>
		<tr class="text-center">
			<th class="text-center">订单类型</th>
			<th class="text-center">订单编号</th>
			<th class="text-center">实收款（元）</th>
			<th class="text-center">发票抬头</th>
			<th class="text-center">收货地址</th>
			<th class="text-center">下单时间</th>
			<th class="text-center">订单状态</th>
			<th class="text-center" width="220">操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${newfind_list}" var="newfind">
		<tr>
			<input type="hidden" id="id" name="id" value='${newfind.ORDERNUM}' />						
			<td class="text-center">购物订单</td>
			<td class="text-center">${newfind.ORDERNUM}</td>
			<td class="text-center">${newfind.PAYMONEY}</td>
			<td class="text-center">${newfind.RECEIPT_TITLE}
<%-- 			<c:choose>  
				<c:when test="${newfind.RECEIPT_TITLE != null}">不开发票</c:when>  
				<c:otherwise>开发票</c:otherwise>  
			</c:choose>  --%>
		</td>
		<td class="text-center">${newfind.PROVINCE}-${newfind.CITY}-${newfind.ADDRESS}</td>
		<td class="text-center">${newfind.APPDATE}</td>
		<td class="text-center">${newfind.STATUS}</td>											
		<td class="td-manage text-center">                                
			<a class="btn btn-primary"
			onClick="newfind_orderInfo(this,'${newfind.ORDERNUM}','${newfind.USER_ID}')" href="javascript:void(0);" title="查看详情">查看</a>
			
			<c:if test="${newfind.DD_STATUS==2}">
				<a class="btn btn-info" onClick="newfind_send(this,'${newfind.ORDERNUM}')" href="javascript:void(0);" title="发货">发货</a>
			</c:if> 
							</tr>
						</c:forEach>
					</tbody>
				</table>
				
			</div>
		</div>
	</div>
	<script src="${ctx}/static/js/jquery.min.js"></script>
	<script src="${ctx}/static/js/bootstrap.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/footable/footable.all.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/validate/jquery.validate.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/validate/messages_zh.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/webuploader/webuploader.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/summernote/summernote.min.js"></script>
	<script
	src="${ctx}/static/js/plugins/summernote/summernote-zh-CN.js"></script>
	<script
	src="${ctx}/static/js/plugins/chosen/chosen.jquery.js"></script>
	<script
	src="${ctx}/static/js/plugins/layer/laydate/laydate.js"></script>
	<script
	src="${ctx}/static/js/plugins/iCheck/icheck.min.js"></script>
	<script
	src="${ctx}/static/plugins/laypage/laypage.js"></script>
	<script
	src="${ctx}/static/js/plugins/switchery/switchery.js"></script>
	<script src="${ctx}/static/js/eModal.min.js"></script>
	<script src="${ctx}/static/js/cookie.js"></script>
	<script src="${ctx}/static/js/content.min.js"></script>
	<script src="${ctx}/static/js/contabs.min.js"></script>
	<script src="${ctx}/static/common/common.js"></script>
	<script
	src="${ctx}/static/js/plugins/ueditor-1.4.3/ueditor.config.js"></script>
	<script
	src="${ctx}/static/js/plugins/ueditor-1.4.3/ueditor.all.js"></script>
	<script
	src="${ctx}/static/js/plugins/uploadify/jquery.uploadify.js"></script>
	<script
	src="${ctx}/static/js/plugins/layer/layer.js"></script>
	<script
	src="${ctx}/static/js/plugins/dataTables/jquery.dataTables.js?v=${static_version}"></script>
	<script
	src="${ctx}/static/js/plugins/dataTables/dataTables.bootstrap.js?v=${static_version}"></script>
	<script src="${ctx}/static/js/My97DatePicker/WdatePicker.js?v=${static_version}"></script>
	<script type="text/javascript">
		/* $("#goods_table_search").click(function(){
		var name=$("#name").val();
		var type=$("#endType").val();
		var type1=$("#type1").val();
		var type2=$("#type2").val();
		var type3=$("#type3").val();
		alert(name);
		alert(type1);
		$.ajax({
			type : "post",
			url : "${ctx}/seller/goods-search",
			data : {name:name,type1:type1,type2:type2,type3:type3,type:type},
			success : function(msg) {
				//location.reload();
			}
		})
	}) */
	$(function() {
		
		$('.table-sort tbody').on('click', 'tr', function() {
			if ($(this).hasClass('selected')) {
				$(this).removeClass('selected');
			} else {
				table.$('tr.selected').removeClass('selected');
				$(this).addClass('selected');
			}
		});
	});

	
	/*发货*/
	function newfind_send(obj,id){
		
		var express_page="${ctx}/dingdan/goExpress?orderNum="+id;
		layer.open({
			  type: 2,
			  skin: 'layui-layer-rim', //加上边框
			  area: ['320px', '340px'], //宽高
			  title: "物流信息",
			  content: express_page
			});
	}
	
	/*删除*/
	function newfind_delete(obj,id){
		var edit_page ="${ctx}/dingdan/newfind-delete";
		layer.confirm('确认删除？', {
			btn: ['确认','取消'], 
			shade: false
		},
		function(){
			$.ajax({
				type : "POST",
				url : edit_page,
				data : "id=" + id,
				error : function() {
					layer.msg('操作失败', {icon:5,time:1000});
				},
				success : function(msg) {
					layer.msg('已删除 ', {icon:6,time:1000});
					$(obj).parents("body").find(".btn-refresh").click();
				}
			});
		},
		function(){
			layer.msg('未删除', {icon:5,time:1000});
		});	
	}
	
	function newfind_orderInfo(obj,id,user_id,w,h){
		var edit_page = "${ctx}/dingdan/newfind-orderinfo-pre?id="+id+"&user_id="+user_id;
		//layer_show("详情页面",edit_page,w,h);
		var index = layer.open({
			type: 2,
			title: "详情页面",
			content: edit_page
		});
		layer.full(index);
	}
	
	$(document).ready(function() {
		$(".dataTables-example").dataTable();
	});
</script>
</body>
</html>